package com.cloud.controller;

import com.cloud.utils.ZookeeperClient;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class WatchApplication implements ApplicationRunner {
    @Resource
    private ZookeeperClient zookeeperClient;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        zookeeperClient.addWatch("/myapp/node1");
    }
}
